2025.7.16 3Dグラフ(ワイヤーフレーム)【matplotlib】
plot_wireframe 関数を使う。
code:p.py
import torch as pt
import matplotlib.pyplot as plt
x = pt.linspace(-5, 5, 20)
y = pt.linspace(-5, 5, 20)
xx, yy = pt.meshgrid(x, y, indexing='xy')
zz = (xx**2 + yy - 11)**2 + (xx + yy**2 - 7)**2
fig = plt.figure()
ax = fig.add_subplot(projection='3d')
ax.plot_wireframe(xx, yy, zz) # <---
plt.show()
https://scrapbox.io/files/6877555c1353f8bd93dcd834.png